﻿
@{
    ViewData["Title"] = "Detail";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<div id="divForm" style="margin:2px;padding:2px;">

    <el-form ref="form" :model="form" label-width="80px">
        <el-row :gutter="24">
            <el-col :span="6">
                <el-form-item label="项目编码" required>
                    <el-input v-model="form.code" disabled></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row :gutter="24">
            <el-col :span="6">
                <el-form-item label="项目名称" required>
                    <el-input v-model="form.projectName" disabled></el-input>
                </el-form-item>
            </el-col>
        </el-row> 
        <el-row :gutter="24">
            <el-col :span="6">
                <el-form-item label="项目排序">
                    <el-input v-model="form.orderIndex" type="number" disabled></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row :gutter="24">
            <el-col :span="6">
                <el-form-item label="状态">
                    <el-radio-group v-model="form.enabled" disabled>
                        <el-radio label="true">启用</el-radio>
                        <el-radio label="false">禁用</el-radio>
                    </el-radio-group>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row :gutter="24">
            <el-col :span="24">
                <el-form-item label="备注">
                    <el-input type="textarea" v-model="form.remark" disabled></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-form-item>
            <el-button @@click="Back()">返回</el-button>
        </el-form-item>
    </el-form>
</div>
<style>
    .el-radio-button__inner, .el-radio-group {
        line-height: inherit !important;
    }

    .el-radio, .el-radio__input {
        line-height: inherit !important;
    }
</style>
<script>
    Vue.prototype.$axios = axios

    var vueProject = new Vue({
        el: '#divForm',
        created() {
            var _this = this;
            _this.GetProject();
        },
        methods: {
            GetProject() {
                var _this = this;
                _this.$axios.get("@Url.Action("getproject", "project")?id="+_this.form.id).then((res) => {
                    _this.form = res;
                });
            }, 
            Back() {
                window.location.href = "@Url.Action("index", "project")";
            }
        },
        data() {
            return {
                form: {
                    id: getQueryString("id")||0,
                    code: "",
                    projectName: "",
                    orderIndex: 0,
                    remark: "",
                    enabled: "true"
                }
            }
        }
    });
</script>
